package com.cohen.anotherclassycalculator;

import java.util.Scanner;

public class main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner input = new Scanner ( System.in );
		boolean realOpperation = false;
		boolean runAgain = true;
		String opp;
		String restart;
		do{
			System.out.println("Please input the first opperand. Numerical values only.");
			double n1 = input.nextDouble();
			System.out.println("Please input the desired opperation.");
			do{
				opp = input.next();
				if (opp.equals("+") == false && opp.equals("-") == false && opp.equals("*") == false && opp.equals("/") == false && opp.equals("^") == false){
					realOpperation = false;	
					System.out.println("'" + opp + "' is not a valid opperation.\nPlease use only '+,' '-,' '*,' '/,' or '^'");
				} else {
					realOpperation = true;
				}
			} while (realOpperation == false);
			System.out.println("Please input the second opperand. Numerical valeus only.");
			double n2 = input.nextDouble();
			if(opp.equals("+") == true){
				System.out.println(n1 + " + " + n2 + " = " + calculator.add(n1,n2));
			} else if (opp.equals("-") == true){
				System.out.println(n1 + " - " + n2 + " = " + calculator.subtract(n1,n2));
			} else if (opp.equals("*") == true){
				System.out.println(n1 + " * " + n2 + " = " + calculator.multiply(n1, n2));
			} else if (opp.equals("/") == true){
				System.out.println(n1 + " / " + n2 + " = " + calculator.divide(n1, n2));
			} else if (opp.equals("^") == true){
				System.out.println(n1 + " ^ " + n2 + " = " + calculator.exponent(n1, n2));

			}
			System.out.println("Continue? y/n");
			boolean correctLetter;
			do {
			restart = input.next();
			if (restart.equals("y") == true){
				runAgain = true;
				correctLetter 
			} else if (restart.equals("n") == true){
				runAgain = false;
			} else {
				
			}
			} while (correctLetter == false); 
		} while (runAgain == true);

	}
}
